
var Loader = new Class({
    block: null,
    initialize: function() {

        this.block = document.id('bloader');
        if(!this.block) {
            this.block = new Element('div#bloader[html=&nbsp;]').inject(document.body);
        }
    },
    show: function() {

        var top = window.getScroll().y + (window.getSize().y / 2); // full size
        var left = window.getScroll().x + (window.getSize().x / 2); // half size
        this.block.set({
            'styles': {
                'padding'   : '10px 0',
                'top'       : top + 'px',
                'left'      : left + 'px',
                'background': 'url("../webstat/img/loader-big.gif") no-repeat center center'
            }
        }).fade('in');

        return;
    },
    hide: function() {

        this.block = document.id('bloader');
        if(this.block) {
            this.block.fade('out');
        }

        return;
    }
});
